package com.zzxy.springSun.service.impl;

import com.zzxy.springSun.dao.IAccountDao;
import com.zzxy.springSun.dao.impl.AccountDaoImpl;
import org.springframework.transaction.annotation.Transactional;

@Transactional(rollbackFor = Exception.class)
public class AccoutServiceImpl implements IAccountService {
    private IAccountDao accountDao;

    private IAccountDao getAccountDao() {
        return new AccountDaoImpl();
    }

    public  void  setAccountDao(IAccountDao accountDao) {
        this. accountDao = accountDao;
    }

    @Override
    public void transer(String outer, String inner, String money) {

    }

    @Override
    public void transer(String outer, String inner, int money) {
    accountDao.out(outer,money);
    int i = 1/0;
    accountDao.in(inner, money);

    }
}
